class Set {
    constructor () {
      this.items = {}
    }
    has (element) {
      return element in this.items
    }
    add (element) {
      if (!this.has(element)) {
        this.items[element] = element
        return true
      }
      return false
    }
    delete (element) {
      if (this.has(element)) {
        delete this.items[element]
        return true
      }
      return false
    }
    clear () {
      this.items = {}
    }
    size () {
      return Object.keys(this.items).length
    }
    values () {
      return Object.values(this.items)
    }
}


function isUnique(str) {
  const charSet = new Set();
  for (const char of str) {
      if (charSet.has(char)) {
          return false;
      }
      charSet.add(char);
  }
  return true;
}

// 示例
console.log(isUnique("leetcode")); // 输出: false
console.log(isUnique("abc")); // 输出: true